
#import "RNOss.h"
#import "OSSManager.h"
@implementation RNOss

- (dispatch_queue_t)methodQueue
{
    return dispatch_get_main_queue();
}
RCT_EXPORT_MODULE()

//文件上传
RCT_REMAP_METHOD(uploadFileArr,
                 fileArr:(NSArray*)paths
                 findEventsWithResolver:(RCTPromiseResolveBlock)resolve
                 rejecter:(RCTPromiseRejectBlock)reject){

  if(paths==nil || paths.count==0){
    reject(@"-1",@"传入为空",nil);
    return;
  }
  [[OSSManager sharedSingleton] uploadFileArr:paths complect:^(NSDictionary * _Nonnull dic) {
    if(dic==nil){
      reject(@"-2",@"有文件上传失败",nil);
    }else{
      resolve(dic);
    }
  }];
}

RCT_EXPORT_METHOD(configWithHost:(NSString*)host){
    [OSSManager sharedSingleton].host = host;
    [[OSSManager sharedSingleton] config];
}


@end
